<template>
  <div class="gallary" @click="handleShowSelf">
    <div class="wrapper">
      <swiper :options="swiperOptions">
        <swiper-slide class="slide-1" v-for="item in gallarryUrlList" :key="item.id">
          <img class="gallary-img" :src="item.imgUrl" alt="">
        </swiper-slide>
        <div class="swiper-pagination number-swiper" slot="pagination"></div>
      </swiper>
    </div>
  </div>
</template>

<script>
export default {
  name: 'Gallary',
  props: {
    gallarryUrlList: {
      type: Array,
      default () {
        return []
      }
    }
  },
  data () {
    return {
      swiperOptions: {
        effect: 'fade',
        fade: {
          crossFade: true
        },
        pagination: '.swiper-pagination',
        paginationType: 'fraction',
        observer: true,
        observeParents: true
      }
    }
  },
  methods: {
    handleShowSelf () {
      this.$emit('showGallary')
    }
  }
}
</script>

<style lang="stylus" scoped>
  .gallary >>> .swiper-container
    overflow: inherit!important
  .gallary
    display: flex
    align-items: center
    position: fixed
    z-index: 66
    top: 0
    left: 0
    right: 0
    bottom: 0
    background-color: #000
    .wrapper
      width: 100%
      .gallary-img
        width: 100%
      .number-swiper
        position: fixed
        bottom: 1rem
        color: #fff
</style>
